<template>
    <!-- html -->
    <div class="Suspense">
        <h2>Suspense</h2>
        <!-- 组件中包含异步操作，使用Suspense组件 -->
        <sx>
            <template v-slot:default>
                <Chinld />
            </template>
            <template v-slot:fallback>
                <h2>加载中......</h2>
            </template>
        </sx>
    </div>
</template>

<script lang="ts" setup name="Suspense">
import Chinld from './Chinld.vue'
import { Suspense as sx } from 'vue'

</script>

<style scoped>
/* 样式 */
.Suspense {
    background-color: #ddd;
    border-radius: 10px;
    padding: 20px;
}
</style>